Super Castlevania 4 Codec
by TFG (palacios_barreda@yahoo.com.mx)
-------------------------

--------
*DISCLAIMER 2008*

This is an old unfinished-unpolished project of mine. I'm passing my progress onto anybody who might be interested. As of now, the code has many bugs. Use it as reference, start-point or whatever. Peace!

MLib: Little functions and stuff...
SNES: Generic SNES rom library...
SCV4Codec: the goood stuff :D
notes_hacks: random notes, a mini-hack, documentation, etc.

-----



Description
-----------

This codec (fancy word for compression/decompression) allows you to extract &
decompress data (graphics, music, et al) from Konami's Super Castlevania 4 for
editing and re-insertion.

Usage
-----

The application is divided into 4 different tabs: Misc., Decompression, Compression and About

-Misc.-

On this tab you can load an SCV4 rom to extract the data from. The codec will automatically 
detect whether the rom has a copier header or not and adjust its calculations to the result.
Also, the program will detect if the rom is LoROM or HiROM for address conversion handling.
SCV4 is LoROM, HiROM support is an added value in the name of fashion, I guess.

-Decompression-

1) Buffer at offset

   Extract data from the previously loaded rom (see Misc.) using the given offset. The codec
   assumes the offset is either an SNES or rom address (in HEX, naturally)
   
2) Pointer at offset

   The game stores a lot of pointers to compressed data in bank $01. Most of the times, you'll
   be dealing with this bank and its contents. This feature is capable of reading the pointer,
   recalculating the address and extracting the data (saving you a couple of steps).
   
3) Single file

   Input: Compressed file (not the rom itself but a manually-ripped buffer)
   Output: Decompressed equivalent
   
-Compression-

1) Single file

   Input: Decompressed file
   Output: Compressed equivalent

Credits
-------

MathOnNapkins: Insane amount of answers and suggestions for my silly questions. I stole his
               SNES -> ROM address conversion formula too :)

Lakmir: "DMA Transfers, Compression, And You" - http://agtp.romhack.net/dmalog/

Contact
-------

palacios_barreda@yahoo.com.mx